//package cn.akwangl.springbootdev.notnull;
//
//
//import org.springframework.web.method.HandlerMethod;
//import org.springframework.web.servlet.ModelAndView;
//import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.lang.reflect.Parameter;
//
//public class ParameterNotBlankInterceptor extends HandlerInterceptorAdapter {
//
//    @Override
//    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
//
//        //如果不是映射到方法直接通过
//        if (!(handler instanceof HandlerMethod)) {
//            return true;
//        }
//        HandlerMethod handlerMethod = (HandlerMethod) handler;
//        Parameter[] methodParameters = handlerMethod.getMethod().getParameters();
//        System.out.println("请求参数======>" + methodParameters);
//        for (int i = 0; i< methodParameters.length; i++){
//            if (methodParameters[i].getAnnotation(ParamNotBlank.class));
////                       if(methodParameters[i].getAnnotation(ParamNotBlank.class) != null){
//////                              CheckParamNull  noblank =methodParameters[i].getAnnotation(CheckParamNull.class);
//////                              Object obj = httpServletRequest.getParameter(methodParameters[i].getName());
//////                              httpServletResponse.setCharacterEncoding("UTF-8");
//////                              if (obj == null){
//////                                httpServletResponse.getWriter().write(JSON.toJSONString(ResponseBo.error(noblank.message())));
//////                                    return false;
//////                                }else if(obj instanceof String && StringUtils.isBlank((String)obj)){
//////                              httpServletResponse.getWriter().write(JSON.toJSONString(ResponseBo.error(noblank.message())));
//////                                      return false;
//////                                }
////                             return true;
////                        }
//                  }
//            return true;
//
//    }
//
//    @Override
//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
//        super.postHandle(request, response, handler, modelAndView);
//    }
//
//    @Override
//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
//        super.afterCompletion(request, response, handler, ex);
//    }
//}